
/**
 * DIY组件库入口文件
 * 根据环境自动导出对应平台组件
 */

// 判断是否为UniApp环境
const isUniApp = typeof uni !== 'undefined'

// Vue3环境组件
import TxzEditorVue3 from './vue3/TxzEditor.vue'

// 导入Vue3组件
import SearchBlock from './vue3/components/SearchBlock.vue'
import ImageBanner from './vue3/components/ImageBanner.vue'
import TitleText from './vue3/components/TitleText.vue'
import Notice from './vue3/components/Notice.vue'
import RichText from './vue3/components/RichText.vue'
import Video from './vue3/components/Video.vue'
import GraphicNavigation from './vue3/components/GraphicNavigation.vue'
import TabBar from './vue3/components/TabBar.vue'
import MagicCube from './vue3/components/MagicCube.vue'
import AuxiliarySegmentation from './vue3/components/AuxiliarySegmentation.vue'
import StoreInformation from './vue3/components/StoreInformation.vue'
import Follow from './vue3/components/Follow.vue'
import Suspension from './vue3/components/Suspension.vue'
import GoodsList from './vue3/components/GoodsList.vue'
import OnlineService from './vue3/components/OnlineService.vue'
import UserCard from './vue3/components/UserCard.vue'
import UserWallet from './vue3/components/UserWallet.vue'
import UserCoupon from './vue3/components/UserCoupon.vue'
import GoodsCard from './vue3/components/GoodsCard.vue'
import GoodsList from './vue3/components/GoodsList.vue'
import MenuGrid from './vue3/components/MenuGrid.vue'
import MenuList from './vue3/components/MenuList.vue'
import CouponCard from './vue3/components/CouponCard.vue'
import SeckillBlock from './vue3/components/SeckillBlock.vue'
import GrouponBlock from './vue3/components/GrouponBlock.vue'
import UserCard from './vue3/components/UserCard.vue'
import UserWallet from './vue3/components/UserWallet.vue'
import UserCoupon from './vue3/components/UserCoupon.vue'

// Vue3组件集合
const vue3Components = {
  TxzEditor: TxzEditorVue3,
  SearchBlock,
  ImageBanner,
  TitleText,
  Notice,
  RichText,
  Video,
  GraphicNavigation,
  TabBar,
  MagicCube,
  AuxiliarySegmentation,
  StoreInformation,
  Follow,
  Suspension,
  GoodsList,
  OnlineService,
  UserCard,
  UserWallet,
  UserCoupon,
  GoodsCard,
  MenuGrid,
  MenuList,
  CouponCard,
  SeckillBlock,
  GrouponBlock
}

// UniApp环境组件（待实现）
// import AsEditorUniApp from './uniapp/AsEditor.vue'
// import SearchBlockUniApp from './uniapp/components/SearchBlock.vue'
// ... 其他UniApp组件

// UniApp组件集合（待实现）
const uniappComponents = {
  // AsEditor: AsEditorUniApp,
  // SearchBlock: SearchBlockUniApp,
  // ... 其他UniApp组件
}

// 根据环境导出对应组件
const components = isUniApp ? uniappComponents : vue3Components

// 导出组件
export default components

// 分别导出各个组件
export const {
  TxzEditor,                          // - 主编辑器组件
  SearchBlock,                        // - 搜索区块组件
  ImageBanner,                        // - 图片广告组件
  TitleText,                          // - 标题文本组件
  Notice,                             // - 公告组件
  RichText,                           // - 富文本组件
  Video,                              // - 视频组件
  GraphicNavigation,                  // - 图文导航组件
  TabBar,                             // - 底部导航组件
  MagicCube,                          // - 魔方组件 
  AuxiliarySegmentation,              // - 辅导航组件
  StoreInformation,                   // - 店铺信息组件
  Follow,                             // - 关注公众号组件
  Suspension,                         // - 悬浮组件
  GoodsList,                          // - 商品列表组件
  OnlineService,                      // - 在线客服组件
  UserCard,                           // - 用户卡片组件
  UserWallet,                         // - 用户钱包组件
  UserCoupon,                         // - 用户优惠券组件
  GoodsCard,                          // - 商品卡片组件
  MenuGrid,                           // - 菜单网格组件
  MenuList,                           // - 菜单列表组件
  CouponCard,                         // - 优惠券卡片组件
  SeckillBlock,                       // - 秒杀区块组件
  GrouponBlock                        // - 团购区块组件
} = components


// 导出共享工具
export { createDiyEditor } from './shared/editor-core.js'
export { COMPONENT_TYPES, COMPONENT_CATEGORIES, COMPONENT_META } from './shared/constants.js'
export * from './shared/utils/index.js'
